The update method updates the value at a given index. The index value must be within a valid range of available data points inside StudyData, otherwise update fails.
update(index, floatValue);
index
Index specifies the location where to update the floating value.
floatValue
Floating value that will be updated.
function calculate(beginIndex, endIndex)
{
var studyData = this.getStudyData("customSMA");
if(studyData != null)
{
//update last value, and set it to 0.00
if(studyData.count() > 0)
{
studyData.update(studyData.count(), 0.00);
}
}
}
Copyright © 2006-2009 ActiveTick LLC